package com.hp.gxw.service.impl;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hp.gxw.entity.SysRole;
import com.hp.gxw.mapper.SysRoleMapper;
import com.hp.gxw.service.ISysRoleService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 角色表 服务实现类
 * </p>
 *
 * @author huangping
 * @since 2020-03-04
 */
@Service
public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> implements ISysRoleService {

	@Override
	public IPage<SysRole> selectInfoPage(Page<SysRole> page, Wrapper<SysRole> ew) {
		return page(page, ew);
	}

	@Override
	public SysRole selectInfoOne(Wrapper<SysRole> ew) {
		return getOne(ew);
	}

	@Override
	public void add(SysRole sysRole) throws Exception {
		save(sysRole);
	}

	@Override
	public void edit(SysRole sysRole) throws Exception {
		updateById(sysRole);
	}

	@Override
	public void delete(Wrapper<SysRole> ew) throws Exception {
		remove(ew);
	}

	@Override
	public List<SysRole> selectInfoList(Wrapper<SysRole> ew) {
		return list(ew);
	}

	@Override
	public long selectInfoCount(Wrapper<SysRole> ew) {
		return count(ew);
	}
}
